'''
    yaml文件的读取操作
'''
# import yaml
#
# def read(file):
#     with open(file=file, mode='r', encoding='utf-8') as f:
#         values = yaml.safe_load(f)
#     return values

from pathlib import Path

import yaml


# def read(file):
#     with open(file=file, mode='r', encoding='utf-8') as f:
#         values = yaml.safe_load(f)
#     return values
def get_project_root():
    """返回项目根目录"""
    return Path(__file__).parent.parent

def read(file_name):
    root = get_project_root()
    file_path = root / 'test/test_yaml' / file_name
    with open(file_path, 'r', encoding='utf-8') as f:
        return yaml.safe_load(f)
